package com.fzg.controller;


import com.fzg.common.enums.ResponseWrapper;
import com.fzg.common.model.collection.param.CheckThisUserExpectWorkIsCollection;
import com.fzg.service.CompanyUserCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fzg
 * @since 2022-03-25
 */
@RestController
@RequestMapping("/company-user-collection")
public class CompanyUserCollectionController {

    @Autowired
    private CompanyUserCollectionService companyUserCollectionService;

    /**
     * 判断当前这个用户有没有被当前登陆的公司收藏
     * @param param 参数类
     * @return ResponseWrapper
     */
    @GetMapping("/checkThisUserExpectWorkIsCollection")
    public ResponseWrapper checkThisUserExpectWorkIsCollection(CheckThisUserExpectWorkIsCollection param){
        return companyUserCollectionService.checkThisUserExpectWorkIsCollection(param);
    }

    /**
     * 企业点击收藏
     * @param param 参数类
     * @return ResponseWrapper
     */
    @PostMapping("/companyCollection")
    public ResponseWrapper companyCollection(@RequestBody CheckThisUserExpectWorkIsCollection param){
        return companyUserCollectionService.companyCollection(param);
    }

    /**
     * 企业取消收藏用户的意向工作
     * @param param 参数类
     * @return ResponseWrapper
     */
    @PostMapping("/cancelCollectUserExpectWork")
    public ResponseWrapper cancelCollectUserExpectWork(@RequestBody CheckThisUserExpectWorkIsCollection param){
        return companyUserCollectionService.cancelCollectUserExpectWork(param);
    }

}
